from flask import Flask

app = Flask(__name__)

@app.route('/')
def f():
    return '''
    <script src="http://cdn.bootcss.com/zepto/1.0rc1/zepto.min.js" ></script>
        <script>
            (function f (){
                setTimeout(function(){
                    $.get('/test/',function(data){
                    alert(data);
                        f();
                    })

                },1000);
            })();
        </script>
    '''


@app.route('/test/')
def f1():
    return 'ok'

app.run(host='0.0.0.0')